PATHMac OS 8 Developer Documentation > Operating System Services > Multiprocessing Services >

Adding Multitasking Capability to Applications Using Multiprocessing Services

   

MPAllocateTaskStorageIndex

Returns an index number to access per-task storage.

OSStatus MPAllocateTaskStorageIndex (TaskStorageIndex *index);
index
A pointer to a variable of type TaskStorageIndex . On return, the variable contains an index number you can use to store task data.
function result
A result code. See Result Codes for a list of possible values.
DISCUSSION

A call to the function MPAllocateTaskStorageIndex returns an index number that is common across all tasks in the current process. You can use this index number in calls to MPSetTaskStorageValue and MPGetTaskStorageValue to set a different value for each task using the same index.

You can think of the task storage area as a two dimensional array cross-referenced by the task storage index number and the task ID. Note that since the amount of per-task storage is determined when the task is created, the number of possible index values associated with a task is limited.

VERSION NOTES

Introduced with Multiprocessing Services 2.0.

SEE ALSO

The function MPDeallocateTaskStorageIndex .


© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)